<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@page isELIgnored="false" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>登陆页面</title>
</head>

<body>
<h1 align="center"><b>欢迎登陆系统</b></h1>
<form method="post" name="form1">
    <table border="2" align="center" cellpadding="0" cellspacing="0" frame="void" rules="none">
        <tr>
            <td align= "right" >用户名：</td>
            <td align="left"><input type="text" name="username" id="username1"></td>
        </tr>
        <tr>
            <td align= "right" >密码：</td>
            <td  align="left"><input type="password" name="password" id="password1"></td>
        </tr>
    </table>
</form>
<p align="center">
    <input type="button" name="login" id="submit" value="登陆" onclick="submit()">
    &nbsp;&nbsp;&nbsp;&nbsp;
    <input type="reset" name="reset" id="reset" value="重置" onclick="reset()">
</p>
<p align="center">${error}</p>
<p>用户在线人数：${applicationScope.get("online").size()}</p>
</body>
<script>
    function submit() {
        var username=document.getElementById("username1").value;
        if (username==""){
            form1.action="Login.html";
        }else{
            form1.action="login"+"-"+username+".html";
        }
        form1.submit();
    }
    function reset() {
        form1.reset();
    }
</script>
</html>
